package Test;

import test.LocalProperties;

import com.objective.oji.OjiApplication;
import com.objective.oji.OjiException;
import com.objective.oji.OjiSession;

public class HelloObjective {
	
	public HelloObjective() {
		
	}
		
	public static void main1(String[] args) {
	
		LocalProperties myProperty = new LocalProperties(null);
		
		
		
		String user_name = myProperty.getProperty("user_name");
		String password = myProperty.getProperty("password");
		String server = myProperty.getProperty("server");
		int port = Integer.parseInt(myProperty.getProperty("port"));
		
		try {	
			OjiApplication objective = new OjiApplication();
			OjiSession apiSession = objective.loginUser(user_name, password, server, port);
			System.out.println("Hello Objective: this is " + apiSession.getCurrentUser().getName() );
			apiSession.logout();
		}
		catch(OjiException e) {
			e.printStackTrace();
		}
	}
}
